<!--
 * @Author: zengwj
 * @Date: 2022-06-27 16:50:51
 * @LastEditors: zengwj
 * @LastEditTime: 2022-06-27 17:35:03
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var a = 10
    function fn() {
      var b = 20
      function bar() {
        console.log(a + b) //30
      }
      return bar
    }
    var x = fn(),
      b = 200
    x() //bar()
  </script>
</body>

</html>